/**
* 提现记录
*/
import React, { Component } from 'react';
import { View, StyleSheet, Text, Image, TouchableOpacity, FlatList, TextInput } from "react-native";
import { connect } from 'react-redux';
import { create_service } from '../../redux/index.js';
import { Contract } from '../../service/index.js';
import { Colors, Dimens, ImageRes } from '../../utils/Assets';
import { ProgressView } from '../custom/index'
import { Actions } from 'react-native-router-flux';
class ProfitDetailView extends Component {

    constructor(props) {
        super(props);
        this.state = {
            loading: false
        }
    }

    componentDidMount() {

    }
    componentWillUnmount() {
    }
    render() {
        let { data } = this.props
        return (
            <View style={styles.container}>
                <View style={{ marginTop: 30, backgroundColor: "#ffffff", marginHorizontal: 15, borderRadius: 10 }}>
                    <Image source={(data.type == '1' || data.type == '2') ? ImageRes.profit_huan : ImageRes.profit_jiang} style={{ width: 100, height: 53, alignSelf: 'center', marginVertical: 30 }}></Image>
                    <View style={{ backgroundColor: Colors.bg_color, height: 1 }}></View>
                    <View style={{ paddingHorizontal: 15 }}>
                        {(data.type == '1' || data.type == '2') && < View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 15 }}>
                            <Text style={{ fontSize: 15, color: "#999999" }}>金额</Text>
                            <Text style={{ fontSize: 15, color: '#333333' }}>{"￥" + data.amount}</Text>
                        </View>}
                        <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 15 }}>
                            <Text style={{ fontSize: 15, color: "#999999" }}>时间</Text>
                            <Text style={{ fontSize: 15, color: '#333333' }}>{data.update_time}</Text>
                        </View>
                        <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 15 }}>
                            <Text style={{ fontSize: 15, color: "#999999" }}>收益</Text>
                            <Text style={{ fontSize: 15, color: '#333333' }}>{"￥" + data.income}</Text>
                        </View>
                        {(data.type == '1' || data.type == '2') && <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 15 }}>
                            <Text style={{ fontSize: 15, color: "#999999" }}>姓名</Text>
                            <Text style={{ fontSize: 15, color: '#333333' }}>{data.product_real_name}</Text>
                        </View>}
                        {(data.type == '1' || data.type == '2') && <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 15 }}>
                            <Text style={{ fontSize: 15, color: "#999999" }}>电话</Text>
                            <Text style={{ fontSize: 15, color: '#333333' }}>{data.product_mobile}</Text>
                        </View>}
                    </View>
                </View>
                <ProgressView show={this.state.loading} />
            </View >
        )
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: Colors.bg_color,
    }
});
const ExportView = connect()(ProfitDetailView);
module.exports.ProfitDetailView = ExportView
